

package inferenceEngine.labels;

/**
 *Represent labels, it contains label name and corresponding recommended degree
 *
 * @author Boshi Li
 */
public class Label {
	//what the label represent
    private String value = "";
    //if the label is represent
    private boolean recommended = false;
    //recommended degree
    private double degree = 1.0;
    public Label( String label ){
        this.setValue(label);
    }
    
	public Label(String name, double degree2) {
		this.value = name;
		this.degree = degree2;
	}
	
	public boolean isRecommended() {
		return recommended;
	}
	public void setRecommended(boolean recommended) {
		this.recommended = recommended;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public double getDegree() {
		return degree;
	}
	public void setDegree(double degree) {
		this.degree = degree;
	}
	@Override
	public boolean equals( Object o ){
		if( ! ( o instanceof Label ) ){
			return false;
		}
		Label target = (Label)o;
		return value.equals( target.getValue() );
	}
	
	@Override
	public int hashCode(  ){
		return value.hashCode();
	}
	
	public String toString(){
		return "'"+value+"'";
	}
	
    
}
